<template>
    <el-dialog
    :title="message"
    :visible.sync="dialogShow"
    width="30%"
    :before-close="handleClose"
    center>
    <span slot="footer" class="dialog-footer">
      <el-button @click="cancel">取 消</el-button>
      <el-button type="primary" @click="confirm">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
    name:'MyDialog',
    props:["callBack","message","show"],
    emits:["close"],
    data(){
        return{
            dialogShow:false,
        }
    },
   watch:{
    show(val){
        this.dialogShow = val;
    }
   },
    methods:{
        confirm(){
            this.callBack();
            this.$emit("close",false);
        },
        cancel(){
            this.$emit("close",false);
        },
        handleClose(){
            this.$emit("close",false);
        }
    }
}
</script>

<style>

</style>